﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="js/LodopFuncs.js"></script>
    <link href="js/PrintSample10.css" rel="stylesheet" />
    <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
            height="0">
        <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0"></embed>
    </object>
</head>
<body>
    <table cellpadding="0" cellspacing="0" border="0" class="numberedList" width="572">
        <tr>
            <td style="vertical-alignment: top" width="739" height="18">
                <a href="javascript:CheckIsInstall()"><b>查看本机是否安装控件</b></a>
            </td>
        </tr>
        <tr>
            <td style="vertical-alignment: top" width="739" height="18">
                <a href="javascript:myPreview()"><b>打印预览</b></a>
            </td>
        </tr>
        <tr>
            <td style="vertical-alignment: top" width="739" height="18">
                <a href="javascript:prn1_preview()"><b>打印表单一<b></a>,
            </td>
        </tr>
        <tr>
            <td style="vertical-alignment: top" width="739" height="18">
                <a href="javascript:prn1_preview()"><b>打印表单二<b></a>,
            </td>
        </tr>
    </table>
    <form id="form1">
        <table border="1" width="300" id="tb01" bgcolor="#CCFFCC" style="border: solid 1px black;
        border-collapse: collapse">
            <tr>
                <td width="133" id="mtb001">
                    <font face="黑体" color="#FF0000" size="3"><u>&nbsp;《表单一》&nbsp;</u></font>
                </td>
            </tr>
        </table>
        <table border="1" width="300" height="106" cellspacing="0" bgcolor="#CCFFFF" style="border-collapse: collapse;
        table-layout: fixed; border: solid 1px black;">
            <tr>
                <td width="66" height="16" style="border: solid 1px black">
                    <font color="#0000FF">A</font><font color="#0000FF">等</font>
                </td>
                <td width="51" height="16" style="border: solid 1px black">
                    <font color="#0000FF">B</font><font color="#0000FF">等</font>
                </td>
                <td width="51" height="16" style="border: solid 1px black">
                    <font color="#0000FF">C</font><font color="#0000FF">等</font>
                </td>
            </tr>
            <tr>
                <td width="66" height="16" style="border: solid 1px black">
                    A<sub>01</sub>
                </td>
                <td width="80" height="12" style="border: solid 1px black">
                    中-001
                </td>
                <td width="51" height="12" style="border: solid 1px black">
                    C1<sup>x</sup>
                </td>
            </tr>
            <tr>
                <td width="66" height="16" style="border: solid 1px black">
                    A<sub>02</sub>
                </td>
                <td width="80" height="16" style="border: solid 1px black">
                    日-スの
                </td>
                <td width="51" height="16" style="border: solid 1px black">
                    <font face='Vernada'>7&#13221</font>
                </td>
            </tr>
            <tr>
                <td width="66" height="16" style="border: solid 1px black; overflow: hidden">
                    A<sub>03</sub><nobr>over隐藏后面的：1234567890</nobr>
                </td>
                <td width="80" height="16" style="border: solid 1px black; overflow: hidden">
                    韩-안녕
                </td>
                <td width="51" height="16">
                    C3<sup>x</sup>
                </td>
            </tr>
        </table>
    </form>
    <script language="javascript" type="text/javascript">
        //检查本级是否安装install_lodop32打印控件
        function CheckIsInstall() {
            try {
                var LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
                if ((LODOP != null) && (typeof (LODOP.VERSION) != "undefined")) {
                    alert("本机已成功安装过Lodop控件!\n  版本号:" + LODOP.VERSION);
                }
            } catch (err) {
                alert("Error:本机未安装或需要升级!");
            }
        };
        var LODOP; //声明为全局变量
        function myPrint() {
            CreatePrintPage();
            LODOP.PRINT();
        };
        function myPrintA() {
            CreatePrintPage();
            LODOP.PRINTA();
        };
        function myPreview() {
            CreatePrintPage();
            LODOP.PREVIEW();
        };
        function mySetup() {
            CreatePrintPage();
            LODOP.PRINT_SETUP();
        };
        function myDesign() {
            CreatePrintPage();
            LODOP.PRINT_DESIGN();
        };
        function myBlankDesign() {
            LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_空白练习");
            LODOP.PRINT_DESIGN();
        };
        function CreatePrintPage() {
            LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_名片");
            LODOP.ADD_PRINT_RECT(10, 55, 360, 220, 0, 1);
            LODOP.SET_PRINT_STYLE("FontSize", 11);
            LODOP.ADD_PRINT_TEXT(20, 180, 100, 25, "郭德强");
            LODOP.SET_PRINT_STYLEA(2, "FontName", "隶书");
            LODOP.SET_PRINT_STYLEA(2, "FontSize", 15);
            LODOP.ADD_PRINT_TEXT(53, 187, 75, 20, "科学家");
            LODOP.ADD_PRINT_TEXT(100, 131, 272, 20, "地址：中国北京社会科学院附近东大街西胡同");
            LODOP.ADD_PRINT_TEXT(138, 132, 166, 20, "电话：010-88811888");
        };
        function myAddHtml() {
            LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INIT("");
            LODOP.ADD_PRINT_HTM(10, 55, "100%", "100%", document.getElementById("textarea01").value);
        };
        // 只打印表单一
        function prn1_preview() {
            CreateOneFormPage();
            LODOP.PREVIEW();
        };
        function CreateOneFormPage() {
            LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_表单一");
            LODOP.SET_PRINT_STYLE("FontSize", 18);
            LODOP.SET_PRINT_STYLE("Bold", 1);
            LODOP.ADD_PRINT_TEXT(50, 231, 260, 39, "打印页面部分内容");
            LODOP.ADD_PRINT_HTM(88, 200, 350, 600, document.getElementById("form1").innerHTML);
        };

    </script>
</body>
</html>
